<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<script type="text/javascript">
	$(document).ready(function() {

		$(loginform).submit(function() {
			if ($("input[name=id]").val() == "") {
				alert("아이디를 입력하세요");
				return false;
			}
			if ($("input[name=password]").val() == "") {
				alert("패스워드를 입력하세요");
				return false;
			}

		});//loginform submit

	});//ready
</script>
<font size="2"><a href="findIdPage.do">아이디</a>/
<a href="findPasswordPage.do">패스워드</a> 찾기
</font>


<br><br>
<c:choose>
	<c:when test="${sessionScope.mvo==null}">
		<div>
			<form name="loginform" method="post" action="login.do">
				아이디<input type="text" name="id"><br> 
				패스워드<input type="password" name="password"><br>
				<input type="hidden" name="path" value="home">  
				<input type=submit value="로그인">
			</form>
			<form action="register.do" method="post" name="registerForm">
				선생님<input type="radio" name="teacher">
				학생<input type="radio" name="student"><br>
				<input type="submit" value="회원가입">
			</form>
		</div>
	</c:when>
	<c:otherwise>
		<form action="logout.do" name="logoutForm" method="post">
			${sessionScope.mvo.name } 님<br> 
			 로그인 하였습니다. <input type="submit" value="로그아웃">
		</form>
	</c:otherwise>
</c:choose>
